/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.fpt.session;

import edu.fpt.entity.BillAll;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author TuanAnh
 */
@Stateless
public class BillAllFacade extends AbstractFacade<BillAll> implements BillAllFacadeLocal {

    @PersistenceContext(unitName = "ProjectManagementHotel-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public BillAllFacade() {
        super(BillAll.class);
    }

    @Override
    public String getDateCome(String id) {
        String date = null;
        List<BillAll> list = findAll();
        for (BillAll bill : list) {
            if (id.equals(bill.getBillId())) {
                date = bill.getDateCome();
            }
        }
        return date;
    }

    @Override
    public int getPriceRoom() {
        int price = 0;
        try {
            List<BillAll> list = findAll();
            for (BillAll bill : list) {
               
            }
        } catch (Exception ex) {
        }
        return 0;
    }
}
